package com.lhkj.ct.admin.modules.statements.controller;

import com.lhkj.ct.base.model.dto.PageQuery;
import com.lhkj.ct.base.model.ro.ActionResult;
import com.lhkj.ct.meta.admin.model.entity.TblEmployee;
import com.lhkj.ct.meta.modules.psychology.model.entity.TblScalePsyRecord;
import com.lhkj.ct.meta.modules.psychology.model.vo.AppointStatisticsVo;
import com.lhkj.ct.meta.modules.psychology.model.vo.PsyStatisticsVo;
import com.lhkj.ct.meta.modules.psychology.model.vo.WorkloadStatisticsVo;
import com.lhkj.ct.meta.modules.statements.service.StatisticsService;
import com.lhkj.ct.meta.modules.scheduling.model.entity.TblScheAppoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("api/plat/statement/statistics")
@Api(tags = "7.1统计报表")
public class StatisticsController {

    @Resource
    private StatisticsService statisticsService;

    @GetMapping(value = "psy")
    @ApiOperation(value = "测验统计")
    public ActionResult<List<PsyStatisticsVo>> psy(TblScalePsyRecord psyRecord, PageQuery pageQuery) {
        return ActionResult.success(statisticsService.psyStatistics(psyRecord, pageQuery));
    }

    @GetMapping(value = "appoint")
    @ApiOperation(value = "预约统计")
    public ActionResult<List<AppointStatisticsVo>> appoint(TblScheAppoint appoint, PageQuery pageQuery) {
        return ActionResult.success(statisticsService.appointStatistics(appoint, pageQuery));
    }

    @GetMapping(value = "workload")
    @ApiOperation(value = "工作量统计")
    public ActionResult<List<WorkloadStatisticsVo>> workload(TblEmployee entity, PageQuery pageQuery) {
        return ActionResult.success(statisticsService.workloadStatistics(entity, pageQuery));
    }

}
